<?php
//vs. Cache !?!
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 08 Nov 1976 01:00:00 GMT"); // Datum in der Vergangenheit

//Session starten und Variablen initialisieren:
session_start();
$session = array('loginstaus'=>false);
foreach($session as $key=>$var)
{
	if(!isset($_SESSION[$key]))
	{
		$_SESSION[$key] = $var;
	}	
}

/**
 * @desc __autoload automatisches Nachladen von Klassen
 * @example $router = new router_system(); /module/system/router.php
 */
function __autoload($classname) {
	$explode_class = explode('_',$classname);
	$filename = 'module/'.$explode_class[1].'/'.$explode_class[0].'.php';
	include_once($filename);
}
//Konfiguration initialisieren
$config = config_system::getInstance();
//router initialisieren:
$router = new router_system();
//view initialisieren:
$view = view_system::getInstance();
//navigation initialisieren
$navigation = navigation_system::getInstance();

//Navigation:
//Navigation:
navigation_system::getInstance()->createNavElement('navigation_auth',  model_auth::getInstance()->getNavigationArray());
$navigation_auth = navigation_system::getInstance()->getNavElement('navigation_auth');
$view->setValue('navigation_auth',$navigation_auth);

navigation_system::getInstance()->createNavElement('navigation_module',$config->getConfig('module','model'));
$navigation_module = navigation_system::getInstance()->getNavElement('navigation_module');
$view->setValue('navigation_module',$navigation_module);

navigation_system::getInstance()->createNavElement('navigation',$config->convertConfig('navigation','link'));
$nav_modules = navigation_system::getInstance()->getNavElement('navigation');
$view->setValue('navigation',$nav_modules);

//Vorlage einbinden:
include('view.phtml');
?>